package video.background.Utils;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @program: emotion
 * @description:
 * @author: hlt
 * @create: 2023-06-20 18:53
 **/
@Data
@AllArgsConstructor
@ApiModel(value = "返回值类")
public class Result {
    @ApiModelProperty(value = "请求码")
    private Integer status;
    @ApiModelProperty(value = "请求消息")
    private String msg;
    @ApiModelProperty(value = "后端返回的数据")
    private Object data;


    // 将封装的信息返回出去
    static public video.background.Utils.Result Success(String msg, Object data){
        return new Result(200, msg, data);
    }
    static public video.background.Utils.Result Error(String msg, Object data){
        return new Result(400, msg, data);
    }
    static public video.background.Utils.Result Error500(String msg, Object data){
        return new Result(500, msg, data);
    }
}
